home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Library / Manuels & Misc / Assembly / AOA.ZIP / SAMPLES / DESCRIBE.ASM < prev    next >
Encoding:
Assembly Source File  |  1993-09-17  |  1.3 KB  |  84 lines

  1.         .xlist
  2.         include     stdlib.a
  3.         includelib    stdlib.lib
  4.         matchfuncs
  5.         .list
  6.  
  7.         include    fpgm.a
  8.  
  9. ; DESCRIBE.ASM-    This file contains the routines which print room and
  10. ;        inventory descriptions.
  11.  
  12. cseg        segment    para public 'code'
  13.         assume    ds:dseg
  14.  
  15. ; LongDesc- Long description of an item.
  16. ; DI points at an item- Give the long description of it.
  17.  
  18. LongDesc    proc
  19.         push    di
  20.         test    di, di
  21.         jz    NoDescription
  22.         mov    di, [di].item.LongDesc
  23.         puts
  24.         putcr
  25. NoDescription:    pop    di
  26.         ret
  27. LongDesc    endp
  28.  
  29.  
  30. ; ShortDesc- Print the short description of an object.
  31. ; DI points at an item (possibly NULL).  Print the short description for it.
  32.  
  33. ShortDesc    proc
  34.         push    di
  35.         test    di, di
  36.         jz    NoDescription
  37.         mov    di, [di].item.ShortDesc
  38.         puts
  39.         putcr
  40. NoDescription:    pop    di
  41.         ret
  42. ShortDesc    endp
  43.  
  44.  
  45.  
  46.  
  47. ; Describe:     "CurRoom" points at the current room.  Describe it and its
  48. ;        contents.
  49.  
  50. Describe    proc
  51.         push    es
  52.         push    bx
  53.         push    di
  54.         mov    di, ds
  55.         mov    es, di
  56.  
  57.         mov    bx, CurRoom
  58.         mov    di, [bx].room.Description
  59.         print
  60.         byte    "You are currently ",0
  61.         puts
  62.         putcr
  63.         print
  64.         byte    "Here you find the following:",cr,lf,0
  65.  
  66. ItemCnt        =    0
  67.         repeat    MaxWeight
  68.         mov    di, [bx].room.ItemList[ItemCnt]
  69.         call    LongDesc
  70.  
  71. ItemCnt        =    ItemCnt+2
  72.         endm
  73.  
  74.  
  75.         pop    di
  76.         pop    bx
  77.         pop    es
  78.         ret
  79. Describe    endp
  80.  
  81. cseg        ends
  82.         end
  83.  
  84.